<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>大卫杜夫 | 雪茄</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="shortcut icon" type="image/ico" href="http://davidoff.com/favicon.ico" />
	<link href="../static/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	<link href="../static/css/main.css" rel="stylesheet">
</head>

<body>
	<div id="header"></div>
	<div class="cigars_detailbox main_cont">
		<div class="page_wrapper"><a class="bread" href="javascript:history.go(-1)">返回雪茄</a></div>
		<div id="kv_wp">
		<script id="kv_tpl" type="text/html">
			<div class="kv"><a href="#"><img src="<%:=kv%>"></a></div>
		</script>
	</div>
		</script>
		<section class="items_box" id="wp">
			<script id="tpl" type="text/html">
				<%for(var i = 0; i < list.length; i++) {%>
				<a class="item" href="detail.html?PRODUCT_ID=<%:=list[i].PRODUCT_ID%>">
				<img src="<%:=JSON.parse(list[i].IMG_URL)[0]%>">
				<h2 class="title"><%:=list[i].PRODUCT_NAME%></h2>
				<%if(list[i].IS_NEW==1){%>
				<div class="icon_new"></div>
				<%}%> 
			</a>   
            <%}%>         
         </script>
		</section>
	</div>
	<!--footer start  -->
	<div id="footer"></div>
	<!--footer end  -->
	<script type="text/javascript" src="../static/lib/fancyBox-2.1.5/lib/jquery-1.10.1.min.js"></script>
	<script src="../static/lib/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="../static/js/common.js"></script>
	<script src="../static/js/template.js"></script>
	<script>
		var ProductList = []
		$(function () {
			let params= {
				"cmd":"product.type.get","param":{"PD_TYPE":getUrlParam('PD_TYPE')}
			}
			$.ajax({
				type: "POST",
				url: "http://davidoff.gemdesign.cn/CMS/api/CMS",
				contentType: "application/json; charset=utf-8",
				data: JSON.stringify(params),
				dataType: "json",
				success: function (data) {
					var ProductTypeInfo = data.ProductTypeInfo
				var tpl = document.getElementById('kv_tpl').innerHTML;
				var html = template(tpl, {
					kv: ProductTypeInfo.KV_IMG_URL
				});
				document.getElementById('kv_wp').innerHTML = html;
				},
				error: function (message) {
					alert(message)
				}
			});
			let prdParams={
				"cmd": "product.list.get",
				"param": {
					"KEY_WORD": getUrlParam('type'),
					"PAGE_INDEX": 1,
					"PAGE_SIZE": 1000
				}
			}
			$.ajax({
				type: "POST",
				url: "http://davidoff.gemdesign.cn/CMS/api/CMS",
				contentType: "application/json; charset=utf-8",
				data: JSON.stringify(prdParams),
				dataType: "json",
				success: function (data) {
					ProductList = data.ProductList
				var tpl = document.getElementById('tpl').innerHTML;
				var html = template(tpl, {
					list: ProductList
				});
				document.getElementById('wp').innerHTML = html;
				},
				error: function (message) {
					alert(message)
				}
			});
		})

	</script>
</body>

</html>
